all: final.pdf

final.pdf: cs  introduction.pdf
	mv introduction.pdf final.pdf

cs:
	@mkdir -p ./step3/build
	cd ./step3/build && cmake ..
	@make -C step3/build
	cp ./step3/build/step-3 .

introduction.pdf: introduction.tex solution.gpl tu.pdf
	xelatex introduction.tex

solution.gpl: step-3
	./step-3

tu.pdf: solution.gpl
	gnuplot tu.gp

clean:
	rm -rf *.aux *.log *.pdf *.gpl ./step3/build step-3


.PHONY: all clean
